package com.kedacom.demo.modularity.ams;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.kedacom.demo.modularity.core.BusinessException;

@Path("/user")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface UserService {

	@POST
	@Path("/add")
	public void create(User user);

	@PUT
	@Path("/update")
	public void update(User user);

	@GET
	@Path("/moid/{moid}")
	public User getByMoid(@PathParam("moid") String moid) throws BusinessException;

	@GET
	@Path("/email/{email}")
	public User getByEmail(@PathParam("email") String email);

	@GET
	@Path("/username/{username}")
	public User getByUsername(@PathParam("username") String username) throws UsernameDoseNotExistException;

	@GET
	@Path("/list")
	public List<User> listAll();

	@DELETE
	@Path("/delete/{moid}")
	public void delete(@PathParam("moid") String moid);

}
